{% extends 'base_list_detail.html' %}
{% block title %}天天生鲜-搜索结果 {% endblock title %}
{% block breadcrumb %}
	<div class="breadcrumb">
		<a href="#">{{ query }}</a>
		<span>></span>
		<a href="#">结果</a>
	</div>
{% endblock breadcrumb %}
{% block main_wrap %}
	<div class="main_wrap clearfix">

		<div class="r_wrap fr clearfix">
			<ul class="goods_type_list clearfix">
				{% for item in page %}
					<li>
						<a href=""><img src="{{ item.object.image.url }}"></a>
						<h4><a href="{% url 'goods:detail' item.object.id %}">{{ sku.name }}</a></h4>
						<div class="operate">
							<span class="prize">￥{{ item.object.price }}</span>
							<span class="unit">{{ item.object.price }}/{{ item.object.unite }}</span>
							<a href="#" class="add_goods" title="加入购物车"></a>
						</div>
					</li>
				{% endfor %}
			</ul>

			<div class="pagenation">
				{% if page.has_previous %}
					<a href="/search?q={{ query }}&page={{ page.previous_page_number }}"> &lt;上一页 </a>
				{% endif %}
				{% for pindex in page.paginator.page_range %}
					{% if pindex == page.number %}
						<a href="/search?q={{ query }}&page={{ pindex }}" class="active">{{ pindex }}</a>
					{% else %}
						<a href="/search?sort={{ query }}&page={{ pindex }}" >{{ pindex }}</a>
					{% endif %}
				{% endfor %}

				{% if page.has_next %}
					<a href="/search?q={{ query }}&page={{ page.next_page_number }}">下一页&gt;</a>
				{% endif %}
			</div>
		</div>
	</div>
{% endblock main_wrap %}
